package com.neuedu.servlet;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;
import com.neuedu.domain.Userinfo;
import com.neuedu.service.ArticleService;
import com.neuedu.service.impl.ArticleServiceImpl;

//@WebServlet("/article/getminemsg")
public class ArticleGetMineServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
 
    public ArticleGetMineServlet() {
        super();

    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		Userinfo user = (Userinfo)request.getSession().getAttribute("login_user");
		int id = user.getId();
		ArticleService as = new ArticleServiceImpl();
		List<Map<String,Object>> minelist = as.getMineMsg(id);
		System.out.println(minelist);
		response.getWriter().print(JSON.toJSONString(minelist));
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
	}

}
